package fr.vvins.core.catalog.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;


/**
 * Domain entity
 */
@Entity
@Table(schema="vvins",name="VV_DOMAIN")
public class Domain extends EntityImpl implements Serializable {


	private static final long serialVersionUID = -8167567077823238660L;
	@Id
	@GeneratedValue
	@Column(name="id")
	private Integer id;

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="COUNTRY_ID")
	private Country country;
	
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="REGION_ID")
	private Region region;
	
	@Basic
	@Column(name="name")
	private String name;

	public Domain() {
	}

	public Domain(Region region, String name) {
		this.region = region;
		this.name = name;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Region getRegion() {
		return region;
	}

	public void setRegion(Region region) {
		this.region = region;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

}
